package com.lhh.springcloud.controller;

import com.lhh.entity.Result;
import com.lhh.springcloud.service.AccountService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 李洪豪
 * @Sno 20220301044
 */
@RestController
public class AccountController {
    @Resource
    private AccountService accountService;
    @PostMapping("/account/update")
    public Result updateAccountMoney(@RequestParam(value = "user_id") Long user_id,
                                     @RequestParam(value = "money") Integer money){
        accountService.updateAccountMoney(user_id,money);
        return Result.success("账户" + user_id+"余额修改成功",null);
    }
}
